package com.chang.member;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;

/*
 * @Author Chang
 * @Date 2024/1/4 14:08
 * @Description
 * 想要远程调用其他服务:
 * 1，引入open-feign和spring-cloud-loadbalancer依赖
 * 2，编写CouponFeignService接口，添加@FeignClient("需要调用的服务名")注解告诉springCloud这个接口需要调用远程服务
 *       声明接口的每一个方法具体是调用哪一个远程服务的哪一个请求 @RequestMapping("coupon/coupon/member/list")
 * 3,启动类开启远程调用功能  @EnableFeignClients
 */

@EnableRedisHttpSession
@EnableFeignClients(basePackages = "com.chang.member.feign")   // 开启远程调用功能
@EnableDiscoveryClient                // 服务注册与发现
@SpringBootApplication
@MapperScan("com.chang.member.mapper")
public class GulimallMemberApplication {

    public static void main(String[] args) {
        SpringApplication.run(GulimallMemberApplication.class, args);
    }

}
